
import * as PIXI from 'pixi.js';
import GAME from 'common/const/game';
import Background from './background';
import ItemFloor from './itemFloor';
import Modal from './modal';
const { Container } = PIXI;

export default class Game {

  constructor({parent}) {

    this.parent = parent;
    this.container = new Container();


    this.background = new Background({parent: this, CONST: GAME.background});

    this.itemFloor = new ItemFloor({parent: this, CONST: GAME.itemFloor});

    this.container._renderModal = this._renderModal;

    this.container.addChild(this.background.container);
    this.container.addChild(this.itemFloor.container);

  }

  _renderModal = (box, onGetItem) => {

    this.modal = new Modal({parent: this, box, onGetItem, CONST: GAME.modal});
    this.container.addChild(this.modal.container);
  };

};
